package servlet;

import java.lang.reflect.Field;

import javax.servlet.http.HttpServletRequest;

public  class fullform {
	public static  Object instance(String formname,HttpServletRequest request)
	{
		Object o = null;
		try {
			Class clazz=Class.forName(formname);
			o=clazz.newInstance();
			Field [] fs=clazz.getDeclaredFields();
			for(Field f:fs)
			{
				f.setAccessible(true);
				f.set(o, request.getParameter(f.getName()));
				f.setAccessible(false);
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
		return o;
	}
}
